udebug-cli: ignore zero-length messages in logstream
authorFelix Fietkau <[email protected]>
Sun, 21 Sep 2025 09:44:41 +0000 (11:44 +0200)
committerFelix Fietkau <[email protected]>
Sun, 21 Sep 2025 09:44:43 +0000 (11:44 +0200)
Prevents stopping the stream when encountering these messages

Signed-off-by: Felix Fietkau <[email protected]>
udebug-cli

index 1f59684acf7b5b9aa9520b70b85e444e4b2edf84..159864341edcd36bb2e5dc44c54240c15d72e8f3 100755 (executable)
@@ -188,6 +188,8 @@ function poll_data() {
        if (length(data) > 0) {
                if (log_out) {
                        udebug.foreach_packet(data, (entry, data, timestamp) => {
+                               if (!length(data))
+                                       return;
                                if ((opts.timestamp && !log_out.write(sprintf("[%.6f] ", timestamp / 1000000.0))) ||
                                        !log_out.write(data) || !log_out.write("\n"))
                                        uloop.end();